package pro.java.impl;

import com.aop.annotation.BussinessAno;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pro.java.service.MyService;

/**
 * author: liubw
 * 接口实现类
 */
@Service
public class MyImpl implements MyService {

    @Autowired
    private MyService myService;//通过自注入的方式 实现cglib代理，使aop能够捕获到方法内部调用

    @BussinessAno(value = "看诊: ",description = "签到")
    @Override
    public String doSomething(String param) {
        myService.methodA();
        return "1";
    }
    @BussinessAno(value = "看诊: ",description = "取药")
    public void methodA() {
        methodB();  // 内部调用不会被切片拦截
        methodC();  // 内部调用不会被切片拦截
    }
    @BussinessAno("看诊: 签到")
    public void methodB() {
    }

    public void methodC() {
    }
}
